<?php
$the_query = new WP_Query(array(
    'post_type' => 'banner',
    'orderby' => 'date',
    'order' => 'asc',
    'posts_per_page' => -1,
    'status' => array('publish','private'),
    'tax_query' => array(
        array(
            'taxonomy' => 'loai-banner',
            'field' => 'slug',
            'terms' => array('banner-trang-chu-trai')
        )
    )
)); ?>

<div id="banner-left" class="carousel slide fl">
    <div class="carousel-inner" >
    <?php $loop = 0; while($the_query->have_posts()) { $the_query->the_post(); $loop++;?>
        <div class="item<?php echo ($loop==1)?" active":"";?>">
            <a href="<?php echo get_post_meta($post->ID,"link",true)?>">
            <?php //woo_image("link=img&width=440&alignment=top&meta".get_the_title());?>
			<?php the_post_thumbnail("large");?>
            </a>
        </div>
    <?php } wp_reset_query(); ?>
    </div>    
    <!-- Carousel nav -->
    <a class="carousel-control left" href="#banner-left" data-slide="prev">&lsaquo;</a>
    <a class="carousel-control right" href="#banner-left" data-slide="next">&rsaquo;</a>
</div>
<script>
jQuery(function($){
    $('#banner-left').carousel({
        interval: 2000
    })
});
</script>



<?php
$the_query = new WP_Query(array(
    'post_type' => 'banner',
    'orderby' => 'date',
    'order' => 'asc',
    'posts_per_page' => -1,
    'status' => array('publish','private'),
    'tax_query' => array(
        array(
            'taxonomy' => 'loai-banner',
            'field' => 'slug',
            'terms' => array('banner-trang-chu-giua')
        )
    )
)); ?>

<div id="banner-center" class="fl">
    <?php $loop = 0; while($the_query->have_posts()) { $the_query->the_post(); $loop++;?>
        <a href="<?php echo get_post_meta($post->ID,"link",true)?>">
            <?php //woo_image("link=img&width=440&alignment=top&meta".get_the_title());?>
			<?php the_post_thumbnail("large");?>
        </a>
    <?php } wp_reset_query(); ?>
</div>



<?php
$the_query = new WP_Query(array(
    'post_type' => 'banner',
    'orderby' => 'date',
    'order' => 'asc',
    'posts_per_page' => -1,
    'status' => array('publish','private'),
    'tax_query' => array(
        array(
            'taxonomy' => 'loai-banner',
            'field' => 'slug',
            'terms' => array('banner-trang-chu-phai')
        )
    )
)); ?>
<div id="banner-right" class="fr">
     <?php $loop = 0; while($the_query->have_posts()) { $the_query->the_post(); $loop++;?>
        <a href="<?php echo get_post_meta($post->ID,"link",true)?>">
            <?php //woo_image("link=img&width=115&alignment=top&meta".get_the_title());?>
			<?php the_post_thumbnail("medium");?>
        </a>
    <?php } wp_reset_query(); ?>
</div>

<div class="clearfix"></div>
<?php
$the_query = new WP_Query(array(
    'post_type' => 'banner',
    'orderby' => 'date',
    'order' => 'asc',
    'posts_per_page' => -1,
    'status' => array('publish','private'),
    'tax_query' => array(
        array(
            'taxonomy' => 'loai-banner',
            'field' => 'slug',
            'terms' => array('banner-trang-chu-duoi')
        )
    )
)); ?>
<div id="banner-bottom" class="clearfix">
     <?php $loop = 0; while($the_query->have_posts()) { $the_query->the_post(); $loop++;?>
        <a class="fl<?php echo ($loop%3==0)?" last":"";?>" href="<?php echo get_post_meta($post->ID,"link",true)?>">
            <?php //woo_image("link=img&width=315&alignment=top&meta".get_the_title());?>
			<?php the_post_thumbnail("large");?>
        </a>
    <?php } wp_reset_query(); ?>
    <div class="clearfix"></div>
</div>
